<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>AWTK-CPP: TListViewH类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">AWTK-CPP
   </div>
   <div id="projectbrief">AWTK CPP API</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="class_t_list_view_h-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">TListViewH类 参考</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a>&gt;</code></p>
<div class="dynheader">
类 TListViewH 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_t_list_view_h.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:a26ddffeffefa075fde4a20c94a2df04e"><td class="memItemLeft" align="right" valign="top"><a id="a26ddffeffefa075fde4a20c94a2df04e"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TListViewH</b> (widget_t *nativeObj)</td></tr>
<tr class="separator:a26ddffeffefa075fde4a20c94a2df04e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a87fbd182499489d77fe748712fa5ccaf"><td class="memItemLeft" align="right" valign="top"><a id="a87fbd182499489d77fe748712fa5ccaf"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TListViewH</b> (const list_view_h_t *nativeObj)</td></tr>
<tr class="separator:a87fbd182499489d77fe748712fa5ccaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e21526f9cb63f695f06479da6e866f3"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_list_view_h.html#a5e21526f9cb63f695f06479da6e866f3">SetItemWidth</a> (int32_t item_width)</td></tr>
<tr class="separator:a5e21526f9cb63f695f06479da6e866f3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1aa7a88f67f2d6e4bd58350c5fd865fb"><td class="memItemLeft" align="right" valign="top">ret_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_list_view_h.html#a1aa7a88f67f2d6e4bd58350c5fd865fb">SetSpacing</a> (int32_t spacing)</td></tr>
<tr class="separator:a1aa7a88f67f2d6e4bd58350c5fd865fb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ade5da48afb23b2870cb1981022cafe57"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_list_view_h.html#ade5da48afb23b2870cb1981022cafe57">GetItemWidth</a> () const</td></tr>
<tr class="separator:ade5da48afb23b2870cb1981022cafe57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae865e72d7a6b2728f84c9bfc80169b45"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_list_view_h.html#ae865e72d7a6b2728f84c9bfc80169b45">GetSpacing</a> () const</td></tr>
<tr class="separator:ae865e72d7a6b2728f84c9bfc80169b45"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:a1a7d71499ea788454e9a986d61236288"><td class="memItemLeft" align="right" valign="top"><a id="a1a7d71499ea788454e9a986d61236288"></a>
static <a class="el" href="class_t_list_view_h.html">TListViewH</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (widget_t *nativeObj)</td></tr>
<tr class="separator:a1a7d71499ea788454e9a986d61236288"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2f0733dca4862c1cf58ceb4120bc3c8a"><td class="memItemLeft" align="right" valign="top"><a id="a2f0733dca4862c1cf58ceb4120bc3c8a"></a>
static <a class="el" href="class_t_list_view_h.html">TListViewH</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const widget_t *nativeObj)</td></tr>
<tr class="separator:a2f0733dca4862c1cf58ceb4120bc3c8a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58ce78859b49910225777c3d406a0c63"><td class="memItemLeft" align="right" valign="top"><a id="a58ce78859b49910225777c3d406a0c63"></a>
static <a class="el" href="class_t_list_view_h.html">TListViewH</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (TWidget &amp;obj)</td></tr>
<tr class="separator:a58ce78859b49910225777c3d406a0c63"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ef9548f5b3cb19df5dbc94e3bca66ee"><td class="memItemLeft" align="right" valign="top"><a id="a1ef9548f5b3cb19df5dbc94e3bca66ee"></a>
static <a class="el" href="class_t_list_view_h.html">TListViewH</a>&#160;</td><td class="memItemRight" valign="bottom"><b>Cast</b> (const TWidget &amp;obj)</td></tr>
<tr class="separator:a1ef9548f5b3cb19df5dbc94e3bca66ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aea1053a459a470681c62da810d4bfc44"><td class="memItemLeft" align="right" valign="top">static TWidget&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_t_list_view_h.html#aea1053a459a470681c62da810d4bfc44">Create</a> (TWidget &amp;parent, xy_t x, xy_t y, wh_t w, wh_t h)</td></tr>
<tr class="separator:aea1053a459a470681c62da810d4bfc44"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>水平列表视图控件。</p>
<p>list_view_h_t是widget\_t的子类控件，widget_t的函数均适用于list_view_h_t控件。</p>
<p>在xml中使用"list\_view\_h"标签创建水平列表视图控件。如：</p>
<div class="fragment"><div class="line">*&lt;<span class="keywordtype">list_view_h</span> <span class="keyword">x</span>=<span class="stringliteral">&quot;center&quot;</span>  <span class="keyword">y</span>=<span class="stringliteral">&quot;10&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;90%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;100&quot;</span> <span class="keyword">item_width</span>=<span class="stringliteral">&quot;200&quot;</span> <span class="keyword">spacing</span>=<span class="stringliteral">&quot;5&quot;</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">scroll_view</span> <span class="keyword">name</span>=<span class="stringliteral">&quot;view&quot;</span> <span class="keyword">w</span>=<span class="stringliteral">&quot;100%&quot;</span> <span class="keyword">h</span>=<span class="stringliteral">&quot;100%&quot;</span>&gt;</div>
<div class="line">*&lt;<span class="keywordtype">image</span> <span class="keyword">style</span>=<span class="stringliteral">&quot;border&quot;</span> <span class="keyword">draw_type</span>=<span class="stringliteral">&quot;auto&quot;</span> <span class="keyword">image</span>=<span class="stringliteral">&quot;1&quot;</span> <span class="keyword">text</span>=<span class="stringliteral">&quot;1&quot;</span>/&gt;</div>
<div class="line">*...</div>
<div class="line">*&lt;/<span class="keywordtype">scroll_view</span>&gt;</div>
<div class="line">*&lt;/<span class="keywordtype">list_view_h</span>&gt;</div>
</div><!-- fragment --><blockquote class="doxtable">
<p>注意：列表项不是作为列表视图控件的直接子控件，而是作为滚动视图的子控件。 </p>
</blockquote>
<blockquote class="doxtable">
<p>更多用法请参考：[list_view_h.xml]( </p>
</blockquote>
<p><a href="https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_h.xml">https://github.com/zlgopen/awtk/blob/master/demos/assets/default/raw/ui/list_view_h.xml</a>)</p>
<p>在c代码中使用函数list_view_h_create创建水平列表视图控件。如：</p>
<p>用代码构造列表视图是比较繁琐的事情，最好用XML来构造。 如果需要动态修改，可以使用widget_clone来增加列表项，使用widget_remove_child来移出列表项。</p>
<p>可用通过style来设置控件的显示风格，如背景颜色和边框颜色等(一般情况不需要)。 </p>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="aea1053a459a470681c62da810d4bfc44"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aea1053a459a470681c62da810d4bfc44">&#9670;&nbsp;</a></span>Create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">TWidget TListViewH::Create </td>
          <td>(</td>
          <td class="paramtype">TWidget &amp;&#160;</td>
          <td class="paramname"><em>parent</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>x</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">xy_t&#160;</td>
          <td class="paramname"><em>y</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>w</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wh_t&#160;</td>
          <td class="paramname"><em>h</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建list_view_h对象</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">parent</td><td>父控件 </td></tr>
    <tr><td class="paramname">x</td><td>x坐标 </td></tr>
    <tr><td class="paramname">y</td><td>y坐标 </td></tr>
    <tr><td class="paramname">w</td><td>宽度 </td></tr>
    <tr><td class="paramname">h</td><td>高度</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>对象。 </dd></dl>

</div>
</div>
<a id="ade5da48afb23b2870cb1981022cafe57"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ade5da48afb23b2870cb1981022cafe57">&#9670;&nbsp;</a></span>GetItemWidth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TListViewH::GetItemWidth </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>列表项的宽度。 </p>

</div>
</div>
<a id="ae865e72d7a6b2728f84c9bfc80169b45"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae865e72d7a6b2728f84c9bfc80169b45">&#9670;&nbsp;</a></span>GetSpacing()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t TListViewH::GetSpacing </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>间距。 </p>

</div>
</div>
<a id="a5e21526f9cb63f695f06479da6e866f3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5e21526f9cb63f695f06479da6e866f3">&#9670;&nbsp;</a></span>SetItemWidth()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TListViewH::SetItemWidth </td>
          <td>(</td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>item_width</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置列表项的宽度。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">item_width</td><td>列表项的宽度。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<a id="a1aa7a88f67f2d6e4bd58350c5fd865fb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1aa7a88f67f2d6e4bd58350c5fd865fb">&#9670;&nbsp;</a></span>SetSpacing()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">ret_t TListViewH::SetSpacing </td>
          <td>(</td>
          <td class="paramtype">int32_t&#160;</td>
          <td class="paramname"><em>spacing</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>设置列表项的间距。</p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">spacing</td><td>列表项的间距。</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>返回</dt><dd>返回RET_OK表示成功，否则表示失败。 </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>output/<a class="el" href="awtk__cpp_8hpp_source.html">awtk_cpp.hpp</a></li>
<li>output/awtk_cpp.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者 &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
